webpackJsonp([28],{

/***/ "EJFb":
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ "PhLB":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/regenerator/index.js
var regenerator = __webpack_require__("lC5x");
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("J0Oq");
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);

// EXTERNAL MODULE: ./node_modules/_moment@2.24.0@moment/moment.js
var moment = __webpack_require__("ryJa");
var moment_default = /*#__PURE__*/__webpack_require__.n(moment);

// EXTERNAL MODULE: ./src/common/api/commonApi.js
var commonApi = __webpack_require__("+/+p");

// EXTERNAL MODULE: ./src/common/plugin/index.js + 207 modules
var common_plugin = __webpack_require__("Tvds");

// CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=script&index=0!./src/common/anjian/law/list.vue


//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//





/* harmony default export */ var list = ({
  data: function data() {
    var _this = this;

    return {
      rightData: [{
        font: 'yt-icon yt-icon-add',
        click: function click() {
          _this.$router.$push('/law/add');
        }
      }, {
        font: 'iconfont icon-calendar',
        click: function click() {
          Object(common_plugin["a" /* Picker */])({
            title: '请选择时间',
            showTemplate: false,
            format: 'YYYY',
            current: '2018',
            confirm: function confirm(year) {
              return _this.refresh(year);
            }
          });
        }
      }],
      active: [],
      taskList: [],
      itemsCellSwipe: [{
        type: 'red',
        text: '删除',
        click: function click(data) {
          _this.$Confirm({
            confirmText: '确认无误',
            cancelText: '容我想想',
            title: '温馨提示',
            desc: '提交后不可修改！您确定要提交吗？'
          }).then(function () {}).catch(function () {});
        }
      }]
    };
  },
  activated: function activated() {
    this.refresh('2018');
  },

  methods: {
    getPercent: function getPercent(item) {
      var len = item.children.length;
      var percent = 0;
      var activeList = item.children.filter(function (v) {
        if (v.state === 2 || v.state === 4 || v.state === 6) {
          return true;
        }
      });
      percent = activeList.length;
      return parseFloat(100 * percent / len).toFixed(0);
    },
    getState: function getState(child) {
      switch (child.state) {
        case 0:
        case 1:
          return {
            text: '待检查',
            state: 'is-default'
          };
        case 2:
        case 4:
        case 6:
          return {
            text: '已完结',
            state: 'is-complete'
          };
        default:
          return {
            text: '进行中',
            state: 'is-active'
          };
      }
    },
    onClick: function onClick(item) {
      this.$router.$push({
        path: '/law/link',
        query: {
          id: item.id,
          enterprise: item.plan_enterprise.id,
          enterpriseName: item.plan_enterprise.attributes.EnterpriseName,
          programme: item.programme_id.id,
          record: item.record_id.id,
          rectify: item.rectify_id.id,
          review: item.review_id.id
        }
      });
    },
    refresh: function refresh(year) {
      var _this2 = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
        var p, taskList, results;
        return regenerator_default.a.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                p = commonApi["a" /* commonApi */].search('law_plan', {
                  contains: { plan_time: year },
                  include: ['plan_enterprise', 'programme_id', 'record_id', 'rectify_id', 'review_id']
                });
                _context.next = 3;
                return _this2.$Loading(p);

              case 3:
                taskList = _context.sent;
                results = [];

                taskList.forEach(function (task) {
                  var time = moment_default()(task.plan_time).format('M[月]');
                  var obj = results.find(function (item) {
                    return item.title === time;
                  });
                  if (!obj) {
                    results.push({
                      title: time,
                      children: [task]
                    });
                  } else {
                    obj.children.push(task);
                  }
                });
                results = results.sort(function (a, b) {
                  return parseInt(a.title) - parseInt(b.title);
                });
                _this2.taskList = results;

              case 8:
              case 'end':
                return _context.stop();
            }
          }
        }, _callee, _this2);
      }))();
    }
  }
});
// CONCATENATED MODULE: ./node_modules/_vue-loader@13.7.3@vue-loader/lib/template-compiler?{"id":"data-v-a6a35f5e","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=template&index=0!./src/common/anjian/law/list.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('yt-page',{attrs:{"title":"执法计划","rightData":_vm.rightData}},[_c('div',{staticClass:"table-head flex"},[_c('span',[_vm._v("时间")]),_vm._v(" "),_c('span',[_vm._v("执法进度")]),_vm._v(" "),_c('span',[_vm._v("操作")])]),_vm._v(" "),_c('yt-collapse',{attrs:{"list":_vm.taskList},scopedSlots:_vm._u([{key:"title",fn:function(props){return _c('div',{staticClass:"flex"},[_c('span',[_vm._v(_vm._s(props.title))]),_vm._v(" "),_c('yt-progress',{staticClass:"line",staticStyle:{"width":"80%"},attrs:{"type":"line","lineHeight":15,"percent":_vm.getPercent(props)}},[_vm._v("\n        "+_vm._s(_vm.getPercent(props))+"%\n      ")])],1)}},{key:"default",fn:function(scope){return _c('div',{},_vm._l((scope.children),function(child,index){return _c('yt-cellSwipe',{key:index,attrs:{"data":1,"items":_vm.itemsCellSwipe}},[_c('div',{staticClass:"flex",on:{"click":function($event){return _vm.onClick(child)}}},[_c('span',[_vm._v(_vm._s(child.plan_enterprise ? child.plan_enterprise.attributes.EnterpriseName : ''))]),_vm._v(" "),_c('span',{class:_vm.getState(child).state},[_vm._v(_vm._s(_vm.getState(child).text))])])])}),1)}}]),model:{value:(_vm.active),callback:function ($$v) {_vm.active=$$v},expression:"active"}})],1)}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var law_list = (esExports);
// CONCATENATED MODULE: ./src/common/anjian/law/list.vue
function injectStyle (ssrContext) {
  __webpack_require__("EJFb")
}
var normalizeComponent = __webpack_require__("C7Lr")
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-a6a35f5e"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  list,
  law_list,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)

/* harmony default export */ var anjian_law_list = __webpack_exports__["default"] = (Component.exports);


/***/ })

});